# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Erkin Batu Altunbaş <erkinbatu@gmail.com>

pkgname=ponysay
pkgver=3.0.3
pkgrel=4
pkgdesc="cowsay reimplemention for ponies"
url="https://github.com/erkin/ponysay"
arch=('any')
license=('GPL3')
depends=('python' 'bash')
makedepends=('git')
source=(https://github.com/erkin/${pkgname}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
        fix-do-not-compare-literal.patch)
sha512sums=('d6ff905404192bdc207952a4a914458d7f25ddcfcea95763ae277a2a3bc7ab33e86a0a229c1b10ff7295b7a89d6e1b61406feefb6bdf9026f4076d0ed70dbe93'
            '372e26a1293d05a37821a5edcbfc2ebb41d751ba4226fa503c07e815c1bb32b6c000293c584babd96e48614bf3b9c4321deb8b28587a37a56783a434615ddeb5')

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -Np1 -i ../fix-do-not-compare-literal.patch
}

build() {
  cd "${pkgname}-${pkgver}"
  export PYTHONHASHSEED=0
  python setup.py build --freedom=partial --everything
}

package() {
  cd "${pkgname}-${pkgver}"
  python setup.py --prefix=/usr --dest-dir="${pkgdir}" --freedom=partial --everything \
    --with-pdf=/usr/share/doc/ponysay --without-pdf-compression \
    --without-info-compression  \
    --without-man-compression \
    install
}
